<!DOCTYPE html>
<html>
<head>
<title>编辑商品分类</title>
[#include "/WEB-INF/admin/include/common.html"]
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>编辑商品分类</h5>
            </div>
           <form id="inputForm" action="update" method="post">
                <input type="hidden" name="id" value="${productCategory.id}" />
                <div class="ibox-content">
                    <div class="form-horizontal clearfix">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">名称：</label>
                            <div class="col-sm-3">
                                <input placeholder="名称" class="form-control" type="text" name="name" value="${productCategory.name}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上级分类：</label>
                            <div class="col-sm-3">
                               <select class="form-control" name="parentId">
                                    <option value="">根目录</option>
                                    [#list productCategoryTree as category]
                                        <option value="${category.id}" [#if category.id == productCategory.parentId] selected="selected"[/#if]>
                                            [#if category.grade != 0]
                                                [#list 1..category.grade as i]
                                                    &nbsp;&nbsp;
                                                [/#list]
                                            [/#if]
                                            ${category.name}
                                        </option>
                                    [/#list]
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">页面标题：</label>
                            <div class="col-sm-3">
                                <input placeholder="页面标题" class="form-control" type="text" name="seoTitle" value="${productCategory.seoTitle}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">页面关键词：</label>
                            <div class="col-sm-3">
                                <input placeholder="页面关键词" class="form-control" type="text" name="seoKeywords" value="${productCategory.seoKeywords}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">页面描述：</label>
                            <div class="col-sm-3">
                                <input placeholder="页面描述" class="form-control" type="text" name="seoDescription" value="${productCategory.seoDescription}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">排序：</label>
                            <div class="col-sm-3">
                                <input placeholder="排序" class="form-control" type="text" name="sort" value="${productCategory.sort}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer col-sm-3 col-sm-offset-2">
                    <button type="submit" class="btn btn-w-m btn-primary">确定</button>
                    <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
$().ready(function() {

    var $inputForm = $("#inputForm");
    
    // 表单验证
    $inputForm.validate({
        rules: {
            "name": "required",
            "sort": "digits"
        }
    });

});
</script>